<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="shortcut icon" href="<!--{eval echo register_static('img/touch-icon-57x57.png');}-->">

    <title>粉粉管理系统</title>

    <!-- Bootstrap core CSS -->
    <link href="<!--{eval echo register_static('css/bootstrap.min.css');}-->" rel="stylesheet">
    <link href="<!--{eval echo register_static('css/bootstrap-reset.css');}-->" rel="stylesheet">

    <!--Animation css-->
    <link href="<!--{eval echo register_static('css/animate.css');}-->" rel="stylesheet">

    <!--Icon-fonts css-->
    <link href="<!--{eval echo register_static('assets/font-awesome/css/font-awesome.css');}-->" rel="stylesheet" />
    <link href="<!--{eval echo register_static('assets/ionicon/css/ionicons.min.css');}-->" rel="stylesheet" />

    <link href="<!--{eval echo register_static('assets/sweet-alert/sweet-alert.min.css');}-->" rel="stylesheet">

    <!-- Plugins css -->
    <link href="<!--{eval echo register_static('assets/modal-effect/css/component.css');}-->" rel="stylesheet">

    <!-- DataTables -->
    <link rel="stylesheet" href="<!--{eval echo register_static('assets/datatables/jquery.dataTables.min.css" rel="stylesheet');}-->" />

    <!-- Custom styles for this template -->
    <link href="<!--{eval echo register_static('css/style.css');}-->" rel="stylesheet">
    <link href="<!--{eval echo register_static('css/helper.css');}-->" rel="stylesheet">

    <!-- My styles for this template -->
    <link href="<!--{eval echo register_static('css/common.css');}-->" rel="stylesheet">
    <link href="<!--{eval echo register_static('assets/timepicker/bootstrap-timepicker.min.css');}-->" rel="stylesheet">
    <link href="<!--{eval echo register_static('assets/timepicker/bootstrap-datepicker.min.css');}-->" rel="stylesheet">

</head>

<body id="mybody">

<!-- Aside Start-->
<!--{template admin_v2/leftside}-->
<!-- Aside Ends-->


<!--Main Content Start -->
<section class="content">

    <!-- Header -->
    <!--{template admin_v2/header}-->
    <!-- Header Ends -->


    <!-- Page Content Start -->
    <!-- ================== -->

    <div class="wraper container-fluid diary-topics">

        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">举报投诉列表</h3>
                    </div>
                    <div class="panel-body">
                        <div class="row" style="margin-bottom: 10px">
                            <div class="col-md-9 col-sm-9 col-xs-9">
                                <!-- Search -->
                                <form class="form-inline" role="form">
                                    <div class="form-group">
                                        <select class="form-control myChoose" name="reasonType" id="reasonType">
                                            <option value="no">举报类型(全部)</option>
                                            <option value="1">垃圾广告</option>
                                            <option value="2">虚假中奖</option>
                                            <option value="3">淫秽色情</option>
                                            <option value="4">敏感信息</option>
                                            <option value="5">泄露隐私</option>
                                            <option value="6">人身攻击</option>
                                            <option value="7">骚扰他人</option>
                                            <option value="8">冒充他人</option>
                                            <option value="9">不实信息</option>
                                            <option value="10">内容抄袭</option>
                                        </select>
                                    </div>
                                    <!--<div class="form-group">-->
                                        <!--<select class="form-control myChoose" name="business" id="yourPayBusiness">-->
                                            <!--<option value="no">订单类型(全部)</option>-->
                                            <!--<option value="0">购买会员</option>-->
                                            <!--<option value="1">订阅号打赏</option>-->
                                            <!--<option value="2">购买粉钻</option>-->
                                            <!--<option value="3">兑换码</option>-->
                                            <!--<option value="4">礼物兑换收益</option>-->
                                            <!--<option value="5">提现申请</option>-->
                                        <!--</select>-->
                                    <!--</div>-->
                                    <button type="button" id="search" class="btn btn-success m-l-10">点击搜索</button>
                                </form>
                            </div>
                            <div class="col-md-3 col-sm-3 col-xs-3">

                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12 col-sm-12 col-xs-12">
                                <table id="datatable" class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th>id</th>
                                        <th>类型</th>
                                        <th>举报者</th>
                                        <th>原因</th>
                                        <th>时间</th>
                                        <th>被举报者</th>
                                        <th>处理状态</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>

                                    <tbody id="tbody">

                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="row" style="margin-top: 15px">
                            <div class="form-group pageCon"></div>
                        </div>
                        <!--<div class="row" style="margin-top: 15px">-->
                            <!--<ul class="pager">-->
                                <!--<li>-->
                                    <!--<a href="{$pageUrl['prev']}"> <i class="fa fa-angle-double-left"></i>上一页</a>-->
                                <!--</li>-->
                                <!--<li>-->
                                    <!--<a href="{$pageUrl['first']}"> <i class="fa"></i>第一页</a>-->
                                <!--</li>-->
                                <!--<li>-->
                                    <!--<a href="{$pageUrl['next']}">下一页 <i class="fa fa-angle-double-right"></i> </a>-->
                                <!--</li>-->
                            <!--</ul>-->
                        <!--</div>-->
                    </div>
                </div>
            </div>
        </div>

    </div>
    <!-- Page Content Ends -->
    <!-- ================== -->

    <div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">

    </div><!-- /.modal -->


    <!-- Footer Start -->
    <!--{template admin_v2/footer}-->
    <!-- Footer Ends -->



</section>
<!-- Main Content Ends -->

<!--template start-->
<script type="text/template" id="tableCon">
    {{#.}}
    <tr>
        <td><label class="label label-success">{{{id}}}</label></td>
        <td><label class="label label-success">{{{userTypeNO2Text reasonType}}}</label></td>
        <td><a target="_blank" href="/admin.php?ac=user_profile&uid={{{uid}}}">{{{nickname}}}<br/>({{{uid}}})</a></td>
        <td style="word-break: break-all;width: 35%"><span style="color: #df8505">{{{userReasonTypeNO2Text reasonRemark reasonType}}}</span></td>
        <td><label class="label label-info">{{{dateConv created_at}}}</label></td>
        <td><a target="_blank" href="/admin.php?ac=user_profile&uid={{{ruid}}}"><span style="color: #8a1f11">{{{rnickname}}}<br/>({{{ruid}}})</span></a></td>
        <td><label class="label label-{{{userReportDealstatusNO2Style status}}}">{{{userReportstatusNO2Text status}}}</label></td>
        <td>
            <div class="btn-group btn-group-sm">
                <button type="button" class="btn btn-danger myStatusReject" data-muid="{{{uid}}}" data-id="{{{id}}}" data-ruid="{{{ruid}}}">无效信息</button>
                <button type="button" class="btn btn-info myStatusDeal" data-muid="{{{uid}}}" data-id="{{{id}}}" data-ruid="{{{ruid}}}">已处理</button>
            </div>
        </td>
    </tr>
    {{/.}}
</script>
<!--template end-->


<!-- js placed at the end of the document so the pages load faster -->
<script src="<!--{eval echo register_static('js/jquery.js');}-->"></script>
<script src="<!--{eval echo register_static('js/bootstrap.min.js');}-->"></script>
<script src="<!--{eval echo register_static('js/pace.min.js');}-->"></script>
<script src="<!--{eval echo register_static('js/wow.min.js');}-->"></script>
<script src="<!--{eval echo register_static('js/jquery.nicescroll.js');}-->" type="text/javascript"></script>
<script src="<!--{eval echo register_static('js/jquery.app.js');}-->"></script>

<script src="<!--{eval echo register_static('js/handlebars-v4.0.5.js');}-->"></script>
<script src="<!--{eval echo register_static('js/handlebars-helper.js');}-->"></script>
<script src="<!--{eval echo register_static('layer/layer.js');}-->"></script>
<script src="<!--{eval echo register_static('laypage/laypage.js');}-->"></script>
<script src="<!--{eval echo register_static('laydate/laydate.js');}-->"></script>

<script src="<!--{eval echo register_static('assets/datatables/jquery.dataTables.min.js');}-->"></script>
<script src="<!--{eval echo register_static('assets/datatables/dataTables.bootstrap.js');}-->"></script>
<script src="<!--{eval echo register_static('assets/sweet-alert/sweet-alert.min.js');}-->"></script>
<script src="<!--{eval echo register_static('assets/sweet-alert/sweet-alert.init.js');}-->"></script>

<!-- Modal-Effect -->
<script src="<!--{eval echo register_static('assets/modal-effect/js/classie.js');}-->"></script>
<script src="<!--{eval echo register_static('assets/modal-effect/js/modalEffects.js');}-->"></script>

<script type="text/javascript">
    $(document).ready(function() {

        //编译模板
        var tp_tableCon = Handlebars.compile($('#tableCon').html());

        $(document).off('#search').on('click','#search',function(){
            _Where_.page = 1;
            var reasonType = $('#reasonType').val();
            reasonType != 'no' ? _Where_.reasonType = reasonType : _Where_.reasonType = undefined;
            RequestList();
        });

        $(document).off('click', '.myStatusReject').on('click', '.myStatusReject', function () {
            var id = $(this).data('id');
            var muid = $(this).data('muid');
            var ruid = $(this).data('ruid');
            if (!id)return;
            layer.confirm('确定将 '+id+' 设为无效信息？', {icon: 3, title:'提示'}, function(i){
                var index = layer.load();
                $.post(
                        '/admin.php?ac=member&op=reportedit&id='+id+'&muid='+muid+'&ruid='+ruid,
                        {status:2},
                        function (r) {
                            layer.close(index);
                            if(r._code == 1){
                                layer.closeAll();
                                RequestList();
                                layer.msg('已设置为 无效信息', {icon: 1});
                            }else{
                                layer.msg('操作异常', {icon: 0});
                            }
                        }
                );
            });
        });

        $(document).off('click', '.myStatusDeal').on('click', '.myStatusDeal', function () {
            var id = $(this).data('id');
            var muid = $(this).data('muid');
            var ruid = $(this).data('ruid');
            if (!id)return;
            layer.confirm('确定将 '+id+' 设为已处理？', {icon: 3, title:'提示'}, function(i){
                var index = layer.load();
                $.post(
                            '/admin.php?ac=member&op=reportedit&id='+id+'&muid='+muid+'&ruid='+ruid,
                        {status:1},
                        function (r) {
                            layer.close(index);
                            if(r._code == 1){
                                layer.closeAll();
                                RequestList();
                                layer.msg('已设置为 已处理', {icon: 1});
                            }else{
                                layer.msg('操作异常', {icon: 0});
                            }
                        }
                );
            });
        });

        _Where_ = {page:1};
        //请求数据列表数据
        var RequestList = function () {
            where = _Where_;
            if(typeof where == 'undefined')where = {};
            var index = layer.load();
            $.post(
                    '/admin.php?ac=member&op=reportlist',
                    where,
                    function (r) {
                        if (r._code == 1){
                            var html = tp_tableCon(r.result);
                            console.log(r.result)
                            $('#tbody').html(html);
                            laypage({
                                cont: $('.pageCon'), //容器。值支持id名、原生dom对象，jquery对象。【如该容器为】：<div id="page1"></div>
                                pages: 100, //通过后台拿到的总页数
                                curr: _Where_.page || 1, //当前页
                                jump: function(obj, first){ //触发分页后的回调
                                    if(!first){ //点击跳页触发函数自身，并传递当前页：obj.curr
                                        _Where_.page = obj.curr;
                                        RequestList();
                                    }
                                }
                            });
                        }else{
                            layer.msg(r._msg, {icon: 0});
                        }
                        layer.close(index);
                    }
            );
        }
        RequestList();

    } );
</script>
</body>
</html>
